<!DOCTYPE html>


<html lang="en">
  

    <head>
      <meta charset="utf-8" />
        
      <meta name="description" content="時光的个人博客" />
      
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
	  <meta name="referrer" content="no-referrer" />

      <title> 時光</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/favicon.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      
<link rel="stylesheet" href="/css/fonts/remixicon.css">

      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
       
 

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
      />
      <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>

      <!-- mermaid -->
      
      <style>
        .swal2-styled.swal2-confirm {
          font-size: 1.6rem;
        }
      </style>
    <link rel="alternate" href="/atom.xml" title="時光" type="application/atom+xml">
</head>
  </html>
</html>


<body>
  <div id="app">
    
      
    <main class="content on">
      
<section class="cover">
    
      
      <a class="forkMe" href="https://github.com/Shen-Yu/hexo-theme-ayer"
        target="_blank"><img width="149" height="149" src="/images/forkme.png"
          class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/cover1.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">時光</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.staticfile.org/typed.js/2.0.12/typed.min.js"></script>


<!-- Subtitle -->

  <script>
    try {
      var typed = new Typed("#subtitle", {
        strings: ['面朝大海，春暖花开', '愿你一生努力，一生被爱', '想要的都拥有，得不到的都释怀'],
        startDelay: 0,
        typeSpeed: 200,
        loop: true,
        backSpeed: 100,
        showCursor: true
      });
    } catch (err) {
      console.log(err)
    }
  </script>
  
<div id="main">
  <section class="outer">
  
  
  

<div class="notice" style="margin-top:50px">
    <i class="ri-heart-fill"></i>
    <div class="notice-content" id="broad"></div>
</div>
<script type="text/javascript">
    fetch('https://v1.hitokoto.cn')
        .then(response => response.json())
        .then(data => {
            document.getElementById("broad").innerHTML = data.hitokoto;
        })
        .catch(console.error)
</script>

<style>
    .notice {
        padding: 20px;
        border: 1px dashed #e6e6e6;
        color: #969696;
        position: relative;
        display: inline-block;
        width: 100%;
        background: #fbfbfb50;
        border-radius: 10px;
    }

    .notice i {
        float: left;
        color: #999;
        font-size: 16px;
        padding-right: 10px;
        vertical-align: middle;
        margin-top: -2px;
    }

    .notice-content {
        display: initial;
        vertical-align: middle;
    }
</style>
  
  <article class="articles">
    
    
    
    
    <article
  id="post-Docker部署去中心化聊天室"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/16/Docker%E9%83%A8%E7%BD%B2%E5%8E%BB%E4%B8%AD%E5%BF%83%E5%8C%96%E8%81%8A%E5%A4%A9%E5%AE%A4/"
    >Docker部署去中心化聊天室</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/16/Docker%E9%83%A8%E7%BD%B2%E5%8E%BB%E4%B8%AD%E5%BF%83%E5%8C%96%E8%81%8A%E5%A4%A9%E5%AE%A4/" class="article-date">
  <time datetime="2023-12-16T02:37:22.325Z" itemprop="datePublished">2023-12-16</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、项目介绍"><a href="#一、项目介绍" class="headerlink" title="一、项目介绍"></a>一、项目介绍</h1><p>需要搭建 <code>Matrix</code> 服务和 <code>Element</code> Web端应用</p>
<p>Matrix 是一个开放的通信协议，用于实时通信，包括即时消息、音频和视频通话。<br>它是去中心化的，这意味着任何人都可以设置自己的 Matrix 服务器，并与其他 Matrix 服务器通信。<br>Matrix 的目标是为所有不同的通信服务提供一个统一的标准，使得不同的服务可以互相通信。</p>
<p>Element 是基于 Matrix 协议的一个客户端应用。<br>它允许用户通过 Matrix 协议进行即时消息、音频和视频通话。<br>Element 有多个版本，包括 Web、桌面和移动应用。<br>它是 Matrix 生态系统中最流行的客户端之一。</p>
<p>Matrix 官方网站：<a target="_blank" rel="noopener" href="https://matrix.org/">https://matrix.org/</a><br>Matrix GitHub 官方仓库：<a target="_blank" rel="noopener" href="https://github.com/matrix-org/synapse">https://github.com/matrix-org/synapse</a><br>Element 官方网站：<a target="_blank" rel="noopener" href="https://element.io/">https://element.io/</a><br>Element 自建 GitHub 地址：<a target="_blank" rel="noopener" href="https://github.com/vector-im/element-web">https://github.com/vector-im/element-web</a></p>
<h1 id="二、安装步骤"><a href="#二、安装步骤" class="headerlink" title="二、安装步骤"></a>二、安装步骤</h1><h2 id="1、绑定域名"><a href="#1、绑定域名" class="headerlink" title="1、绑定域名"></a>1、绑定域名</h2><p>需要分别为 <code>Matrix</code> 和 <code>Element</code> 绑定域名，各添加一条A记录</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216103438808-1079332897.png" alt="image-20231216103439701"></p>
<h2 id="2、添加反向代理"><a href="#2、添加反向代理" class="headerlink" title="2、添加反向代理"></a>2、添加反向代理</h2><p>使用 <code>Nginx Proxy Manager</code> 添加反向代理，我分别使用8008和8009端口，注意开放相应防火请</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216104142659-1351285830.png" alt="image-20231216104143585"></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216104034892-860427198.png" alt="image-20231216104035864"></p>
<p>可以再设置一下SSL</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216104304537-911226898.png" alt="image-20231216104305597"></p>
<h2 id="3、部署服务"><a href="#3、部署服务" class="headerlink" title="3、部署服务"></a>3、部署服务</h2><p>创建目录</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> -p /root/docker_data/matrix</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> /root/docker_data/matrix</span><br></pre></td></tr></table></figure>

<p>拉取并运行镜像，注意修改 <code>SYNAPSE_SERVER_NAME</code> 为自己刚才设置的matrix需绑定的域名</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">sudo docker run -it --<span class="built_in">rm</span> \</span><br><span class="line">-v /root/docker_data/matrix/data:/data \</span><br><span class="line">-e SYNAPSE_SERVER_NAME=matrix.shiguangdev.eu.org \</span><br><span class="line">-e SYNAPSE_REPORT_STATS=<span class="built_in">yes</span> \</span><br><span class="line">matrixdotorg/synapse:latest generate</span><br></pre></td></tr></table></figure>

<p>修改 <code>homeserver.yaml</code> 文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /root/docker_data/matrix/data</span><br><span class="line"></span><br><span class="line">vim homeserver.yaml</span><br></pre></td></tr></table></figure>

<p>在最底部添加以下内容，打开注册功能以及跳过注册验证</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">enable_registration: true</span><br><span class="line">enable_registration_without_verification: true</span><br></pre></td></tr></table></figure>

<p>如图所示</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216111206506-1747171155.png" alt="image-20231216111207502"></p>
<p>创建 <code>docker-compose.yml</code> 文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd /root/docker_data/matrix</span><br><span class="line">vim docker-compose.yml</span><br></pre></td></tr></table></figure>

<p>粘贴以下内容，注意将 <code>VIRTUAL_HOST</code>、<code>LETSENCRYPT_HOST</code>、<code>SYNAPSE_SERVER_NAME</code> 替换为自己的域名</p>
<p>如端口需调整，注意修改</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">version: &quot;3.3&quot;</span><br><span class="line"></span><br><span class="line">services:</span><br><span class="line">  synapse:</span><br><span class="line">    image: &quot;matrixdotorg/synapse:latest&quot;</span><br><span class="line">    container_name: &quot;matrix_synapse&quot;</span><br><span class="line">    restart: unless-stopped</span><br><span class="line">    ports:</span><br><span class="line">      - 8008:8008</span><br><span class="line">    volumes:</span><br><span class="line">      - &quot;./data:/data&quot; # it will look at the current directory where you save the file and look for the data folder inside</span><br><span class="line">    environment:</span><br><span class="line">      VIRTUAL_HOST: &quot;matrix.shiguangdev.eu.org&quot;</span><br><span class="line">      VIRTUAL_PORT: 8008</span><br><span class="line">      LETSENCRYPT_HOST: &quot;matrix.shiguangdev.eu.org&quot;</span><br><span class="line">      SYNAPSE_SERVER_NAME: &quot;matrix.shiguangdev.eu.org&quot;</span><br><span class="line">      SYNAPSE_REPORT_STATS: &quot;yes&quot;</span><br><span class="line">  element-web:</span><br><span class="line">    ports:</span><br><span class="line">      - &#x27;8009:80&#x27;</span><br><span class="line">    #volumes:</span><br><span class="line">    #    - &#x27;/etc/element-web/config.json:/app/config.json&#x27;</span><br><span class="line">    image: vectorim/element-web</span><br><span class="line">    restart: unless-stopped</span><br></pre></td></tr></table></figure>

<p>执行 <code>docker-compose up -d</code> </p>
<p>通过 ip+端口 或者域名即可访问 </p>
<p>Matrix服务</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216111939375-1481886112.png" alt="image-20231216111940434"></p>
<p>Element</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216112512215-782901218.png" alt="image-20231216112511645"></p>
<p>若出现以下错误，需用域名访问，并且使用https的方式访问，反向代理时，SSL可勾选 <code>Force SSL</code> 强制https访问</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216115241484-1378905479.png" alt="image-20231216115239099"></p>
<h2 id="4、注册账号与使用"><a href="#4、注册账号与使用" class="headerlink" title="4、注册账号与使用"></a>4、注册账号与使用</h2><h3 id="4-1-注册账号"><a href="#4-1-注册账号" class="headerlink" title="4.1 注册账号"></a>4.1 注册账号</h3><p>可以调整语言为简体中文</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216113645928-1507737593.png" alt="image-20231216113640915"></p>
<p>创建账户 &#x3D;&gt; 编辑 &#x3D;&gt; 使用自己搭建的Matrix服务</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216113818269-1292002415.png" alt="image-20231216113802377"></p>
<p>设置用户名及密码</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216114010475-1037490128.png" alt="image-20231216113954180"></p>
<p>这个界面可以跳过</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216114312568-40872563.png" alt="image-20231216114256868"></p>
<p>至此账号已经创建完成</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216114356300-1469636097.png" alt="image-20231216114342244"></p>
<p>点击头像可以查看账户地址</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216120229818-1549433554.png" alt="image-20231216120215840"></p>
<p>或者在所有设置 &#x3D;&gt; 通用 &#x3D;&gt; 个人资料查看</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216120422432-324325353.png" alt="image-20231216120419789"></p>
<h3 id="4-2-日常对话"><a href="#4-2-日常对话" class="headerlink" title="4.2 日常对话"></a>4.2 日常对话</h3><p>新创建跟个账户模拟聊天，输入对方账户地址，前往</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216120603180-1034483934.png" alt="image-20231216120549415"></p>
<p>模拟向对方发送一条消息</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216120700131-163692231.png" alt="image-20231216120646646"></p>
<p>对方会收到邀请通知</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216120819274-1229705909.png" alt="image-20231216120805384"></p>
<p>对方可以接受聊天或者拒绝</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216120859680-348034285.png" alt="image-20231216120846117"></p>
<p>回复一条消息</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216121012437-1912795107.png" alt="image-20231216120958779"></p>
<p>你接收到的消息</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216121127847-1783790803.png" alt="image-20231216121114678"></p>
<h3 id="4-3-房间及视频通话"><a href="#4-3-房间及视频通话" class="headerlink" title="4.3 房间及视频通话"></a>4.3 房间及视频通话</h3><p>可以创建房间，类似群的功能</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216121442571-156016793.png" alt="image-20231216121439987"></p>
<p>如果需要视频通话，可以在设置 &#x3D;&gt; 实验室 &#x3D;&gt; 加入beta</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216121637081-433229662.png" alt="image-20231216121623465"></p>
<p>加入beta 后就可以创建视频房间了</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216121820516-93927935.png" alt="image-20231216121807060"></p>
<p>模拟创建一个视频房间</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216122138940-140971214.png" alt="image-20231216122131578"></p>
<p>要求成员加入，被要求人也需加入beta</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216122138480-1948953704.png" alt="image-20231216122125001"></p>
<p>被邀请人加入beta后可接受要求</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216122218181-1818224132.png" alt="image-20231216122205067"></p>
<p>开启视频和麦克风权限后就能开启视频通话了</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231216122355789-854176605.png" alt="image-20231216122342282"></p>
<h2 id="5、更新服务"><a href="#5、更新服务" class="headerlink" title="5、更新服务"></a>5、更新服务</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /root/docker_data/matrix</span><br><span class="line"></span><br><span class="line">docker-compose pull</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"> <span class="comment"># 请不要使用 docker-compose stop 来停止容器，因为这么做需要额外的时间等待容器停止</span></span><br><span class="line"> <span class="comment"># docker-compose up -d 直接升级容器时会自动停止并立刻重建新的容器,可以节省一些时间</span></span><br><span class="line">docker-compose up -d   </span><br><span class="line"></span><br><span class="line"><span class="comment"># prune 命令用来删除不再使用的 docker 对象。删除所有未被 tag 标记和未被容器使用的镜像</span></span><br><span class="line">docker image prune  </span><br></pre></td></tr></table></figure>

<h2 id="6、卸载服务"><a href="#6、卸载服务" class="headerlink" title="6、卸载服务"></a>6、卸载服务</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /root/docker_data/matrix</span><br><span class="line"></span><br><span class="line">docker-compose down</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> ..</span><br><span class="line"></span><br><span class="line"><span class="built_in">rm</span> -rf /root/docker_data/matrix  <span class="comment"># 完全删除</span></span><br></pre></td></tr></table></figure>



<p><strong>参考文章</strong></p>
<blockquote>
<p><a target="_blank" rel="noopener" href="https://blog.laoda.de/archives/docker-compose-install-matrix-element/">https://blog.laoda.de/archives/docker-compose-install-matrix-element/</a></p>
</blockquote>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Docker/" rel="tag">Docker</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Element/" rel="tag">Element</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Maxtri/" rel="tag">Maxtri</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-Docker部署ChatBotUI"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/13/Docker%E9%83%A8%E7%BD%B2ChatBotUI/"
    >Docker部署ChatBotUI</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/13/Docker%E9%83%A8%E7%BD%B2ChatBotUI/" class="article-date">
  <time datetime="2023-12-13T12:23:33.000Z" itemprop="datePublished">2023-12-13</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、项目介绍"><a href="#一、项目介绍" class="headerlink" title="一、项目介绍"></a>一、项目介绍</h1><p><a target="_blank" rel="noopener" href="https://github.com/mckaywrigley/chatbot-ui">Github地址</a>:<a target="_blank" rel="noopener" href="https://github.com/mckaywrigley/chatbot-ui">https://github.com/mckaywrigley/chatbot-ui</a></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231213203846434-7036829.png" alt="image-20231213203840126"></p>
<h1 id="二、安装步骤"><a href="#二、安装步骤" class="headerlink" title="二、安装步骤"></a>二、安装步骤</h1><h3 id="2-1-Vercel一键部署"><a href="#2-1-Vercel一键部署" class="headerlink" title="2.1 Vercel一键部署"></a>2.1 <a target="_blank" rel="noopener" href="https://vercel.com/new/clone?repository-url=https://github.com/mckaywrigley/chatbot-ui">Vercel一键部署</a></h3><h3 id="2-2-本地构建"><a href="#2-2-本地构建" class="headerlink" title="2.2 本地构建"></a>2.2 本地构建</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker build -t chatgpt-ui .</span><br><span class="line">docker run -e OPENAI_API_KEY=xxxxxxxx -p 3000:3000 chatgpt-ui</span><br></pre></td></tr></table></figure>

<h3 id="2-3-从-ghcr-拉取"><a href="#2-3-从-ghcr-拉取" class="headerlink" title="2.3 从 ghcr 拉取"></a>2.3 从 ghcr 拉取</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run -e OPENAI_API_KEY=xxxxxxxx -p 3000:3000 ghcr.io/mckaywrigley/chatbot-ui:main</span><br></pre></td></tr></table></figure>

<p>修改 <code>OPENAI_API_KEY</code>，替换为你的 OpenAI key</p>
<p>可在登录OpenAi后访问<a target="_blank" rel="noopener" href="https://platform.openai.com/api-keys">https://platform.openai.com/api-keys</a>  进行创建</p>
<p>安全组放行 3000端口</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ChatBotUI/" rel="tag">ChatBotUI</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ChatGPT/" rel="tag">ChatGPT</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Docker/" rel="tag">Docker</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-Docker部署ChatGPTNextWeb"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/12/Docker%E9%83%A8%E7%BD%B2ChatGPTNextWeb/"
    >Docker部署chatgpt-next-web</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/12/Docker%E9%83%A8%E7%BD%B2ChatGPTNextWeb/" class="article-date">
  <time datetime="2023-12-12T13:49:25.975Z" itemprop="datePublished">2023-12-12</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、ChatGPT-Next-Web介绍"><a href="#一、ChatGPT-Next-Web介绍" class="headerlink" title="一、ChatGPT Next Web介绍"></a>一、ChatGPT Next Web介绍</h1><h2 id="1-1-主要功能"><a href="#1-1-主要功能" class="headerlink" title="1.1 主要功能"></a>1.1 主要功能</h2><ul>
<li>在 1 分钟内使用 Vercel <strong>免费一键部署</strong></li>
<li>精心设计的 UI，响应式设计，支持深色模式</li>
<li>极快的首屏加载速度（~100kb）</li>
<li>海量的内置 prompt 列表，来自<a target="_blank" rel="noopener" href="https://github.com/PlexPt/awesome-chatgpt-prompts-zh">中文</a>和<a target="_blank" rel="noopener" href="https://github.com/f/awesome-chatgpt-prompts">英文</a></li>
<li>自动压缩上下文聊天记录，在节省 Token 的同时支持超长对话</li>
<li>一键导出聊天记录，完整的 Markdown 支持</li>
<li>拥有自己的域名？好上加好，绑定后即可在任何地方</li>
<li><strong>无障碍</strong>快速访问</li>
</ul>
<h2 id="1-2-项目展示"><a href="#1-2-项目展示" class="headerlink" title="1.2 项目展示"></a>1.2 项目展示</h2><p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212215534136-932614054.png" alt="image-20231212215518278"></p>
<p>GitHub地址：<a target="_blank" rel="noopener" href="https://github.com/Yidadaa/ChatGPT-Next-Web">https://github.com/Yidadaa/ChatGPT-Next-Web</a></p>
<p>演示 Demo: <a target="_blank" rel="noopener" href="https://chat-gpt-next-web.vercel.app/">https://chat-gpt-next-web.vercel.app/</a></p>
<h1 id="二、搭建步骤"><a href="#二、搭建步骤" class="headerlink" title="二、搭建步骤"></a>二、搭建步骤</h1><h2 id="2-1-Vercel一键部署"><a href="#2-1-Vercel一键部署" class="headerlink" title="2.1 Vercel一键部署"></a>2.1 Vercel一键部署</h2><ol>
<li>准备好你的 <a target="_blank" rel="noopener" href="https://platform.openai.com/account/api-keys">OpenAI API Key</a></li>
<li>点击右侧按钮开始部署： <a target="_blank" rel="noopener" href="https://vercel.com/new/clone?repository-url=https://github.com/Yidadaa/ChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web">Deploy with Vercel</a>，直接使用 Github 账号登录即可，记得在环境变量页填入 API Key 和 <a target="_blank" rel="noopener" href="https://github.com/Yidadaa/ChatGPT-Next-Web/blob/main/README_CN.md#%E9%85%8D%E7%BD%AE%E9%A1%B5%E9%9D%A2%E8%AE%BF%E9%97%AE%E5%AF%86%E7%A0%81">页面访问密码</a> CODE</li>
<li>部署完毕后，即可开始使用</li>
<li><a target="_blank" rel="noopener" href="https://vercel.com/docs/concepts/projects/domains/add-a-domain">绑定自定义域名</a>（可选）：Vercel 分配的域名 DNS 在某些区域被污染了，绑定自定义域名即可直连。</li>
</ol>
<h2 id="2-2-VPS部署"><a href="#2-2-VPS部署" class="headerlink" title="2.2 VPS部署"></a>2.2 VPS部署</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> -p /root/docker_data/chatgpt-next-web</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> /root/docker_data/chatgpt-next-web</span><br><span class="line"></span><br><span class="line">vim docker-compose.yml</span><br></pre></td></tr></table></figure>

<p>英文模式下输入 <code>i</code> ，粘贴以下内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">version: <span class="string">&#x27;3.3&#x27;</span></span><br><span class="line">services:</span><br><span class="line">    chatgpt-next-web:</span><br><span class="line">        ports:</span><br><span class="line">            - <span class="string">&#x27;3000:3000&#x27;</span></span><br><span class="line">        environment:</span><br><span class="line">            - OPENAI_API_KEY=sk-xxxx    <span class="comment"># 填写你的API KEY</span></span><br><span class="line">            - CODE=your-password    <span class="comment"># 填一个密码，不然你的额度很快就会被刷完</span></span><br><span class="line">        image: yidadaa/chatgpt-next-web</span><br></pre></td></tr></table></figure>

<p>修改以下内容</p>
<p><code>OPENAI_API_KEY</code> : 你的 OpenAI key，可在登录OpenAi后访问<a target="_blank" rel="noopener" href="https://platform.openai.com/api-keys">https://platform.openai.com/api-keys</a>  进行创建</p>
<p><code>CODE</code>: 访问密码，别人可以用你的访问密码进行登录，不过消耗的是你的Api额度</p>
<p>修改好之后，按一下 <code>esc</code>，然后 <code>:wq</code> 保存退出</p>
<p>安全组放行 3000端口，也可调整为其他端口，例如调整为8080端口</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ports:</span><br><span class="line">      - <span class="string">&#x27;8080:3000&#x27;</span></span><br></pre></td></tr></table></figure>

<p>新增放行规则</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212224316514-1406546274.png" alt="image-20231212224301362"></p>
<p>执行 <code>docker-compose up -d</code> 进行部署</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212224345228-823966038.png" alt="image-20231212224328365"></p>
<p>部署成功后首次访问会进入如下界面，可输入访问密码进行访问</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212231934248-894426409.png" alt="image-20231212231934511"></p>
<h1 id="三、更新"><a href="#三、更新" class="headerlink" title="三、更新"></a>三、更新</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /root/docker_data/chatgpt-next-web</span><br><span class="line"></span><br><span class="line">docker-compose down </span><br><span class="line"></span><br><span class="line"><span class="built_in">cp</span> -r /root/docker_data/chatgpt-next-web /root/docker_data/chatgpt-next-web.archive  <span class="comment"># 万事先备份，以防万一</span></span><br><span class="line"></span><br><span class="line">docker-compose pull</span><br><span class="line"></span><br><span class="line">docker-compose up -d    <span class="comment"># 请不要使用 docker-compose stop 来停止容器，因为这么做需要额外的时间等待容器停止；docker-compose up -d 直接升级容器时会自动停止并立刻重建新的容器，完全没有必要浪费那些时间。</span></span><br><span class="line"></span><br><span class="line">docker image prune  <span class="comment"># prune 命令用来删除不再使用的 docker 对象。删除所有未被 tag 标记和未被容器使用的镜像</span></span><br></pre></td></tr></table></figure>

<p>提示：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">WARNING! This will remove all dangling images.</span><br><span class="line">Are you sure you want to <span class="built_in">continue</span>? [y/N] </span><br></pre></td></tr></table></figure>

<p>输入 <code>y</code></p>
<h1 id="四、卸载"><a href="#四、卸载" class="headerlink" title="四、卸载"></a>四、卸载</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /root/docker_data/chatgpt-next-web</span><br><span class="line"></span><br><span class="line">docker-compose down</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> ..</span><br><span class="line"></span><br><span class="line"><span class="built_in">rm</span> -rf /root/docker_data/chatgpt-next-web  <span class="comment"># 完全删除映射到本地的数据</span></span><br></pre></td></tr></table></figure> 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/AI/" rel="tag">AI</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ChatGPT/" rel="tag">ChatGPT</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Docker/" rel="tag">Docker</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-私有化部署LobeChat"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/12/%E7%A7%81%E6%9C%89%E5%8C%96%E9%83%A8%E7%BD%B2LobeChat/"
    >私有化部署LobeChat</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/12/%E7%A7%81%E6%9C%89%E5%8C%96%E9%83%A8%E7%BD%B2LobeChat/" class="article-date">
  <time datetime="2023-12-12T12:51:50.658Z" itemprop="datePublished">2023-12-12</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、LobeChat介绍"><a href="#一、LobeChat介绍" class="headerlink" title="一、LobeChat介绍"></a>一、LobeChat介绍</h1><p>LobeChat 是开源的高性能聊天机器人框架，支持语音合成、多模态、可扩展的（<a target="_blank" rel="noopener" href="https://sspai.com/post/81986">Function Call</a>）插件系统。<br>支持一键免费部署私人 ChatGPT&#x2F;LLM 网页应用程序。</p>
<p>官方 GitHub 地址：<a target="_blank" rel="noopener" href="https://github.com/lobehub/lobe-chat">https://github.com/lobehub/lobe-chat</a><br>官方 Demo：<a target="_blank" rel="noopener" href="https://chat-preview.lobehub.com/">https://chat-preview.lobehub.com</a><br>官方文档：<a target="_blank" rel="noopener" href="https://github.com/lobehub/lobe-chat/wiki">https://github.com/lobehub/lobe-chat/wiki</a></p>
<h1 id="二、安装步骤"><a href="#二、安装步骤" class="headerlink" title="二、安装步骤"></a>二、安装步骤</h1><h2 id="一、Vercel一键部署"><a href="#一、Vercel一键部署" class="headerlink" title="一、Vercel一键部署"></a>一、Vercel一键部署</h2><p>点击 <a target="_blank" rel="noopener" href="https://vercel.com/new/clone?repository-url=https://github.com/lobehub/lobe-chat&env=OPENAI_API_KEY&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.&envLink=https://platform.openai.com/account/api-keys&project-name=lobe-chat&repository-name=lobe-chat">一键部署</a>，登录账号</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222153218010-864679030.png" alt="image-20231222153219601"></p>
<p>创建仓库</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222153359196-575911394.png" alt="image-20231222153400768"></p>
<p>填写 OPEN_API_KEY</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222153426384-607924925.png" alt="image-20231222153427973"></p>
<p>点击Deploy进行部署，等待部署完成撒花即可</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222154915216-808373939.png" alt="image-20231222154916680"></p>
<p>然后就可以愉快地聊天了</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222155527698-1740800352.png" alt="image-20231222155529190"></p>
<p>如果你想设置访问密码，可以在设置页面添加环境变量，变量名称为 <code>ACCESS_CODE</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222155512704-172738501.png" alt="image-20231222155514166"></p>
<p>然后重新部署下项目使配置生效</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222160400445-645353136.png" alt="image-20231222160401999"></p>
<p>设置访问密码后许输入正确的访问密码才能使用</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222162431466-555845917.png" alt="image-20231222162433068"></p>
<h2 id="二、Docker-Compose部署"><a href="#二、Docker-Compose部署" class="headerlink" title="二、Docker Compose部署"></a>二、Docker Compose部署</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">sudo -i</span><br><span class="line"></span><br><span class="line"><span class="built_in">mkdir</span> -p /root/docker_data/lobe</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> /root/docker_data/lobe</span><br><span class="line"></span><br><span class="line">vim docker-compose.yml</span><br></pre></td></tr></table></figure>

<p>英文模式下输入 <code>i</code> ，粘贴以下内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">version: <span class="string">&#x27;3.8&#x27;</span></span><br><span class="line"></span><br><span class="line">services:</span><br><span class="line">  lobe-chat:</span><br><span class="line">    image: lobehub/lobe-chat</span><br><span class="line">    container_name: lobe-chat</span><br><span class="line">    ports:</span><br><span class="line">      - <span class="string">&#x27;3210:3210&#x27;</span></span><br><span class="line">    environment:</span><br><span class="line">      OPENAI_API_KEY: sk-xxxx</span><br><span class="line">      ACCESS_CODE: sglobe</span><br></pre></td></tr></table></figure>

<p>修改以下内容</p>
<p><code>OPENAI_API_KEY</code>: 你的 OpenAI key，可在登录OpenAi后访问<a target="_blank" rel="noopener" href="https://platform.openai.com/api-keys">https://platform.openai.com/api-keys</a>  进行创建</p>
<p><code>ACCESS_CODE</code>: 访问密码，别人可以用你的访问密码进行登录，不过消耗的是你的Api额度</p>
<p>修改好之后，按一下 <code>esc</code>，然后 <code>:wq</code> 保存退出</p>
<p>安全组放行 3210端口，也可调整为其他端口，例如调整为8080端口</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ports:</span><br><span class="line">      - <span class="string">&#x27;8080:3210&#x27;</span></span><br></pre></td></tr></table></figure>

<p>新增放行规则</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212232741703-57579546.png" alt="image-20231212232741903"></p>
<p>执行 <code>docker-compose up -d</code>  进行部署</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212215156853-1344483284.png" alt="image-20231212215152969"></p>
<p>部署成功后首次访问进入如下界面</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212233148729-1134227535.png" alt="image-20231212233148931"></p>
<p>使用以下命令即可使用一键启动 LobeChat 服务：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ docker run -d -p 3210:3210 \</span><br><span class="line">  -e OPENAI_API_KEY=sk-xxxx \</span><br><span class="line">  -e ACCESS_CODE=lobe66 \</span><br><span class="line">  lobehub/lobe-chat</span><br></pre></td></tr></table></figure>

<p>如果你需要通过代理使用 OpenAI 服务，你可以使用 <code>OPENAI_PROXY_URL</code> 环境变量来配置代理地址：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ docker run -d -p 3210:3210 \</span><br><span class="line">  -e OPENAI_API_KEY=sk-xxxx \</span><br><span class="line">  -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \</span><br><span class="line">  -e ACCESS_CODE=lobe66 \</span><br><span class="line">  lobehub/lobe-chat</span><br></pre></td></tr></table></figure>

<h3 id="2-1环境变量"><a href="#2-1环境变量" class="headerlink" title="2.1环境变量"></a>2.1环境变量</h3><p>该项目提供了一些额外的配置项，使用环境变量进行设置：</p>
<table>
<thead>
<tr>
<th>环境变量</th>
<th>类型</th>
<th>描述</th>
<th>示例</th>
</tr>
</thead>
<tbody><tr>
<td><code>OPENAI_API_KEY</code></td>
<td>必选</td>
<td>这是你在 OpenAI 账户页面申请的 API 密钥</td>
<td><code>sk-xxxxxx...xxxxxx</code></td>
</tr>
<tr>
<td><code>OPENAI_PROXY_URL</code></td>
<td>可选</td>
<td>如果你手动配置了 OpenAI 接口代理，可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL</td>
<td><code>https://api.chatanywhere.cn/v1</code> 默认值: <code>https://api.openai.com/v1</code></td>
</tr>
<tr>
<td><code>OPENAI_FUNCTION_REGIONS</code></td>
<td>可选</td>
<td>当你使用 Vercel 部署 Lobe-Chat，而且有需求指定响应调用 OpenAI 接口的请求的 Edge Function 的 Region 时，可以使用该配置进行配置，该值的类型为逗号分隔的字符串数组</td>
<td><code>iad1,sfo1</code></td>
</tr>
<tr>
<td><code>ACCESS_CODE</code></td>
<td>可选</td>
<td>添加访问此服务的密码，你可以设置一个长密码以防被爆破</td>
<td><code>awCTe)re_r74</code> or <code>rtrt_ewee3@09!</code></td>
</tr>
</tbody></table>
<h3 id="2-2-更新"><a href="#2-2-更新" class="headerlink" title="2.2 更新"></a>2.2 更新</h3><blockquote>
<p>项目最近更新比较频繁，建议大家及时跟着更新。</p>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="built_in">cd</span> /root/docker_data/lobe</span><br><span class="line"></span><br><span class="line">docker-compose pull</span><br><span class="line"></span><br><span class="line">docker-compose up -d    <span class="comment"># 请不要使用 docker-compose stop 来停止容器，因为这么做需要额外的时间等待容器停止；docker-compose up -d 直接升级容器时会自动停止并立刻重建新的容器，完全没有必要浪费那些时间。</span></span><br><span class="line"></span><br><span class="line">docker image prune  <span class="comment"># prune 命令用来删除不再使用的 docker 对象。删除所有未被 tag 标记和未被容器使用的镜像</span></span><br></pre></td></tr></table></figure>

<p>提示：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">WARNING! This will remove all dangling images.</span><br><span class="line">Are you sure you want to <span class="built_in">continue</span>? [y/N] </span><br></pre></td></tr></table></figure>

<p>输入 <code>y</code></p>
<h3 id="2-3-卸载"><a href="#2-3-卸载" class="headerlink" title="2.3 卸载"></a>2.3 卸载</h3><p>同样进入安装页面，先停止所有容器。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /root/docker_data/lobe</span><br><span class="line"></span><br><span class="line">docker-compose down</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> ..</span><br><span class="line"></span><br><span class="line"><span class="built_in">rm</span> -rf /root/docker_data/lobe  <span class="comment"># 完全删除</span></span><br></pre></td></tr></table></figure>

<h1 id="五、使用"><a href="#五、使用" class="headerlink" title="五、使用"></a>五、使用</h1><h2 id="1、设置自定义提示词"><a href="#1、设置自定义提示词" class="headerlink" title="1、设置自定义提示词"></a>1、设置自定义提示词</h2><p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222135305306-1362709418.png" alt="image-20231222135306808"></p>
<h2 id="2、内置角色"><a href="#2、内置角色" class="headerlink" title="2、内置角色"></a>2、内置角色</h2><p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222135041711-371853021.png" alt="image-20231222135042998"></p>
<h2 id="3、插件商店"><a href="#3、插件商店" class="headerlink" title="3、插件商店"></a>3、插件商店</h2><p>有天气、时钟、搜索引擎 和 网络爬虫等实用插件</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222135749892-1547570060.png" alt="image-20231222135751427"></p>
<p>例如用询问一下最近一周Github上star最多的项目</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222134040177-466104423.png" alt="image-20231222134041240"></p>
<p>使用该功能需绑定插件API密钥</p>
<p>联网插件API获取：<a target="_blank" rel="noopener" href="https://serpapi.com/">https://serpapi.com/</a></p>
<p>注册需要邮箱即手机号验证</p>
<p>免费账号一个月有100次调用额度</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222134744785-835642275.png" alt="image-20231222134746196"></p>
<h2 id="4、语音功能"><a href="#4、语音功能" class="headerlink" title="4、语音功能"></a>4、语音功能</h2><p>点击小话筒可以语音输入，也可将反馈的结果语音朗读</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222140301226-1367517709.png" alt="image-20231222140257503"></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/AI/" rel="tag">AI</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ChatGPT/" rel="tag">ChatGPT</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Docker/" rel="tag">Docker</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/LobeChat/" rel="tag">LobeChat</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Vercel/" rel="tag">Vercel</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-宝塔面板调整80和443端口"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/12/%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF%E8%B0%83%E6%95%B480%E5%92%8C443%E7%AB%AF%E5%8F%A3/"
    >宝塔面板调整80和443端口</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/12/%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF%E8%B0%83%E6%95%B480%E5%92%8C443%E7%AB%AF%E5%8F%A3/" class="article-date">
  <time datetime="2023-12-12T06:52:11.000Z" itemprop="datePublished">2023-12-12</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%A5%BD%E8%AE%B0%E6%80%A7%E4%B8%8D%E5%A6%82%E7%83%82%E7%AC%94%E5%A4%B4/">好记性不如烂笔头</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p>宝塔新建的站点默认端口为80端口，SSL证书需要占用443端口，而这两个端口很容易被占用</p>
<h1 id="调整80端口"><a href="#调整80端口" class="headerlink" title="调整80端口"></a>调整80端口</h1><p>nginx管理 &#x3D;&gt; 配置修改 ，调整80端口，也可直接修改 <code>/www/server/nginx/conf/nginx.conf</code> 文件</p>
<p>如果新增的站点无法访问，可能也是由于nginx未自动添加server配置导致的，也可在此添加server配置</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212145650038-1212308578.png" alt="image-20231212145650099"></p>
<p>还需修改 <code>/www/server/panel/vhost/nginx/0.default.conf</code> 文件</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212150339836-367305500.png" alt="image-20231212150340041"></p>
<h1 id="调整443端口"><a href="#调整443端口" class="headerlink" title="调整443端口"></a>调整443端口</h1><p>仍需修改 <code>/www/server/panel/vhost/nginx</code> 目录下各站点的配置文件，每个站点都有一个与之对应配置文件</p>
<p>例如我将443端口修改为442端口</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212150546384-436066569.png" alt="image-20231212150546825"></p>
<p>查看端口是否被占用 <code>lsof -i :port</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211213321639-124871882.png" alt="image-20231211213320802"></p>
<p>或者 <code>netstat -anp |grep port</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211225358748-1749741549.png" alt="image-20231211225357973"></p>
<p>结束进程 <code>kill -9 pid</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211213647745-122213543.png" alt="image-20231211213647203"></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF/" rel="tag">宝塔面板</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-Linux 常用命令"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/11/Linux%20%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/"
    >Linux常用命令</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/11/Linux%20%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" class="article-date">
  <time datetime="2023-12-11T13:47:03.809Z" itemprop="datePublished">2023-12-11</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%A5%BD%E8%AE%B0%E6%80%A7%E4%B8%8D%E5%A6%82%E7%83%82%E7%AC%94%E5%A4%B4/">好记性不如烂笔头</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p><strong>重置</strong></p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">bash &lt;(wget --no-check-certificate -qO- <span class="string">&#x27;https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh&#x27;</span>) -d 11 -v 64 -p lion123 -port 22</span><br></pre></td></tr></table></figure>



<p><strong>更新环境</strong></p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt update -y &amp;&amp; apt upgrade -y &amp;&amp; apt install -y curl wget sudo socat</span><br></pre></td></tr></table></figure>







<p><strong>安装 Docker</strong></p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl -fsSL https://get.docker.com | sh</span><br></pre></td></tr></table></figure>





<p>查看端口是否被占用 <code>lsof -i :port</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211213321639-124871882.png" alt="image-20231211213320802"></p>
<p>或者 <code>netstat -anp |grep port</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211225358748-1749741549.png" alt="image-20231211225357973"></p>
<p>结束进程 <code>kill -9 pid</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211213647745-122213543.png" alt="image-20231211213647203"></p>
<p>查看ip</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">c</span><br></pre></td></tr></table></figure>



<p>docker </p>
<p>docker 查看容器 <code>docker ps</code>   </p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211213450226-277229003.png" alt="image-20231211213449696"></p>
<p>部署docker-compose容器  <code>docker-compose up -d</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231211214853543-1527502799.png" alt="image-20231211214852943"></p>
<p>查看 Docker 内网地址</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ip addr show docker0</span><br></pre></td></tr></table></figure>

 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Linux/" rel="tag">Linux</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-Docker部署Nginx Proxy Manager"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/10/Docker%E9%83%A8%E7%BD%B2Nginx%20Proxy%20Manager/"
    >Docker部署Nginx Proxy Manager</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/10/Docker%E9%83%A8%E7%BD%B2Nginx%20Proxy%20Manager/" class="article-date">
  <time datetime="2023-12-10T02:20:52.505Z" itemprop="datePublished">2023-12-10</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <blockquote>
<p>官网地址：<a target="_blank" rel="noopener" href="https://nginxproxymanager.com/">https://nginxproxymanager.com/</a></p>
<p>github: <a target="_blank" rel="noopener" href="https://github.com/NginxProxyManager/nginx-proxy-manager">https://github.com/NginxProxyManager/nginx-proxy-manager</a></p>
</blockquote>
<p>更新环境</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt update -y &amp;&amp; apt install -y curl socat wget sudo</span><br></pre></td></tr></table></figure>

<p>安装 Docker 及  docker-compose </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">curl -fsSL https://get.docker.com | sh</span><br><span class="line"></span><br><span class="line">curl -L &quot;https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose </span><br><span class="line"></span><br><span class="line">chmod +x /usr/local/bin/docker-compose</span><br></pre></td></tr></table></figure>

<p>创建目录并进入目录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">mkdir -p /root/docker_data/nginx-proxy-manager</span><br><span class="line"></span><br><span class="line">cd /root/docker_data/nginx-proxy-manager</span><br></pre></td></tr></table></figure>

<p>创建docker-compose.yml的文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nano docker-compose.yml</span><br></pre></td></tr></table></figure>

<p>复制代码进入文件中</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">version: &#x27;3.8&#x27;</span><br><span class="line"></span><br><span class="line">services:</span><br><span class="line"></span><br><span class="line"> app:</span><br><span class="line"></span><br><span class="line">  image: &#x27;jc21/nginx-proxy-manager:latest&#x27;</span><br><span class="line"></span><br><span class="line">  restart: unless-stopped</span><br><span class="line"></span><br><span class="line">  ports:</span><br><span class="line"></span><br><span class="line">   \- &#x27;80:80&#x27;</span><br><span class="line"></span><br><span class="line">   \- &#x27;81:81&#x27;</span><br><span class="line"></span><br><span class="line">   \- &#x27;443:443&#x27;</span><br><span class="line"></span><br><span class="line">  volumes:</span><br><span class="line"></span><br><span class="line">   \- ./data:/data</span><br><span class="line"></span><br><span class="line">   \- ./letsencrypt:/etc/letsencrypt</span><br></pre></td></tr></table></figure>



<p>中文版本</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">image:</span> <span class="string">&#x27;chishin/nginx-proxy-manager-zh:latest&#x27;</span></span><br></pre></td></tr></table></figure>



<p>crl＋x 然后y 然后回车退出编辑模式</p>
<p>注意：80 和 443 端口不能修改，否则会出现 <code>Internal Error</code> 错误</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222224356678-886363766.png" alt="image-20231222224350178"></p>
<p>启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose up -d</span><br></pre></td></tr></table></figure>



<p>默认用户名密码</p>
<p>Email: <a href="mailto:&#97;&#100;&#109;&#x69;&#x6e;&#64;&#x65;&#120;&#97;&#109;&#112;&#x6c;&#x65;&#x2e;&#x63;&#111;&#x6d;">&#97;&#100;&#109;&#x69;&#x6e;&#64;&#x65;&#120;&#97;&#109;&#112;&#x6c;&#x65;&#x2e;&#x63;&#111;&#x6d;</a></p>
<p>Password: changeme</p>
<p>首次登录需要设置管理员账户信息</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222222931716-582424306.png" alt="image-20231222222932729"></p>
<p>重置密码</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231222223213968-1680502182.png" alt="image-20231222223215266"></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Docker/" rel="tag">Docker</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Nginx-Proxy-Managerg/" rel="tag">Nginx Proxy Managerg</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-使用Notion搭建个人博客"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/09/%E4%BD%BF%E7%94%A8Notion%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/"
    >基于Notion搭建个人博客</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/09/%E4%BD%BF%E7%94%A8Notion%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time datetime="2023-12-09T15:44:15.935Z" itemprop="datePublished">2023-12-09</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%B0%8F%E6%8A%80%E8%83%BD/">小技能</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、注册Notion账号"><a href="#一、注册Notion账号" class="headerlink" title="一、注册Notion账号"></a>一、注册Notion账号</h1><p>官网地址： <a target="_blank" rel="noopener" href="https://notion.so/">https://notion.so</a> </p>
<p>注册并登录后会进入以下界面</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203111834565-1985047491.png" alt="image-20231203111836563"></p>
<h2 id="复制Notion模版"><a href="#复制Notion模版" class="headerlink" title="复制Notion模版"></a>复制Notion模版</h2><p>登录账号之后，打开 <a target="_blank" rel="noopener" href="https://mulberry-table-1ab.notion.site/6bff0ff4f0ee4e88866963af3df06459?v=7adb45c325184cbdb788d2a46151d693&pvs=4">Notion模版</a></p>
<p>点击  <code>Duplicating</code> 可将模板复制到自己网站了</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203112446396-1262362748.png" alt="image-20231203112441593"></p>
<p>模版克隆到到个人账户之后，点击右上角的<code>Share</code>-&gt;<code>Publish</code>-&gt;<code>Publish to Web</code>，那么互联网上的用户就能使用这个链接来访问我们的个人页面了。</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203112908341-230980311.png" alt="image-20231203112855722"></p>
<h1 id="二、Github拉取NotionNext项目"><a href="#二、Github拉取NotionNext项目" class="headerlink" title="二、Github拉取NotionNext项目"></a>二、Github拉取NotionNext项目</h1><p>将 <a target="_blank" rel="noopener" href="https://github.com/tangly1024/NotionNext">NotionNext</a>项目 fork到自己的github</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203134126939-2030233651.png" alt="image-20231203134120620"></p>
<p>这份代码就是我们搭建个人网站的关键，这个<code>NotionNext</code>调用了Notion的API来展示Notion的页面，同时提供了一些主题和特效，可以定制化我们的网站效果。</p>
<p>对于这个仓库，我们唯一需要关注的就是<code>blog.config.js</code>文件，我们的所有主题特效修改都只需要改这个配置文件即可。</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203134437080-543563237.png" alt="image-20231203134420553"></p>
<h1 id="三、Vercel部署"><a href="#三、Vercel部署" class="headerlink" title="三、Vercel部署"></a>三、Vercel部署</h1><p>注册或登录 <a target="_blank" rel="noopener" href="https://vercel.com/">Vercel</a>，建议用github账号进行登录，选择添加新项目</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203134753235-548529958.png" alt="image-20231203134737665"></p>
<p>选择 <code>NotionNext</code> 项目点击 import 导入	</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203134910892-18088007.png" alt="image-20231203134855110"></p>
<p>需要配置一下环境变量</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203135220773-1810457554.png" alt="image-20231203135215324"></p>
<p>即 <code>blog.config.js</code> 中的 <code>NOTION_PAGE_ID</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203135342963-1340418864.png" alt="image-20231203135326877"></p>
<p>复制Notion的分享链接</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203135418803-1658229512.png" alt="image-20231203135401960"></p>
<p>仅需复制id即可</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203135618676-442327012.png" alt="image-20231203135600686"></p>
<p>点击 <code>Add</code> 添加到环境变量，然后点击<code>Display</code>进行部署</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203135713622-320557183.png" alt="image-20231203135658205"></p>
<p>部署需要几分钟，部署成功如下所示</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203140132868-953470058.png" alt="image-20231203140116799"></p>
<h1 id="四、绑定域名"><a href="#四、绑定域名" class="headerlink" title="四、绑定域名"></a>四、绑定域名</h1><blockquote>
<p> 由于中国大陆专属的域名污染，vercel自动分配域名可能访问不成功,可以绑定注册好的域名进行访问</p>
</blockquote>
<p>可以直接点击<code>Add Domain</code>进行添加，也可以直接打开 <code>Setting</code> 页面进行添加</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203140459837-677598931.png" alt="image-20231203140449960"></p>
<p>填写已经注册好的域名</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203140711224-1949075351.png" alt="image-20231203140655802"></p>
<p>添加后提示不合法，需要添加 A记录 和 CNAME 记录</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203140759339-883355551.png" alt="image-20231203140743210"></p>
<p>到域名管理平台绑定域名，此处以 CloudFlare 为例，由于我已经添加过CNAME记录，再添加一条 A记录即可</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203141936268-76175839.png" alt="image-20231203141935573"></p>
<p>配置好可以看到已经显示配置合法了</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203142135984-987814425.png" alt="image-20231203142135410"></p>
<p>点击域名即可直接访问了</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203142641167-1244220942.png" alt="image-20231203142620968"></p>
<h1 id="五、信息修改"><a href="#五、信息修改" class="headerlink" title="五、信息修改"></a>五、信息修改</h1><h2 id="基本信息修改"><a href="#基本信息修改" class="headerlink" title="基本信息修改"></a>基本信息修改</h2><p>博客介绍的一些基本信息可以从 <code>blog.config.js </code>直接修改，也可以从Vercel的环境变量进行修改</p>
<p>具体操作为： <code>Project</code> &#x3D;&gt; <code>Settings</code> &#x3D;&gt;  <code>Environment Variables</code> 进行添加</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231212155631939-2017769511.png" alt="image-20231212155632392"></p>
<p>所有带有<code>process.env</code>前缀的变量，都可以在<code>Notion</code>里面添加环境变量配置来覆盖，同<code>NOTION_PAGE_ID</code>一样，意味着如果你不想修改<code>NotionNext</code>代码仓库，是完全可行的。</p>
<p>同时NotionNext代码仓库还有着其它非常丰富的配置可以修改，甚至可以显示主题选项，随时一键切换主题，显示鼠标点击特效，动态特效，宠物挂件，音乐播放插件，等等。</p>
<p>在github上修改并提交后会触发Vercel自动部署</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231203143558040-1030329818.png" alt="image-20231203143537013"></p>
<h2 id="Notion模版介绍"><a href="#Notion模版介绍" class="headerlink" title="Notion模版介绍"></a>Notion模版介绍</h2><p>这个模版是一个表格，表格的每一行是一篇博客，我们可以在表格上面进行编辑，</p>
<p>解释一下表格各个列的意义：</p>
<ul>
<li><code>type</code> - Post：博客，Menu: 菜单， SubMenu: 子菜单 ， Page：菜单（归档，留言，友链等），Notice：公告</li>
<li><code>status</code> - Published: 已发布，Invisible：不可见，Draft：草稿</li>
<li><code>title</code> - 具体的博客内容，点击Open即可打开编辑</li>
<li><code>slug</code> - 链接后缀，不填就是默认的notion的随机字符串，可读性不好，建议填写</li>
</ul>
<p>模板修改后需在Vercel上重新部署方可生效</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Notion/" rel="tag">Notion</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-Docker搭建青龙面板"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/09/Docker%E6%90%AD%E5%BB%BA%E9%9D%92%E9%BE%99%E9%9D%A2%E6%9D%BF/"
    >Docker搭建青龙面板</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/09/Docker%E6%90%AD%E5%BB%BA%E9%9D%92%E9%BE%99%E9%9D%A2%E6%9D%BF/" class="article-date">
  <time datetime="2023-12-09T15:44:15.932Z" itemprop="datePublished">2023-12-09</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、简介"><a href="#一、简介" class="headerlink" title="一、简介"></a>一、简介</h1><p>青龙面板是一个支持 Python3、JavaScript、Shell、Typescript 的定时任务管理平台</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221951329-737339706.png" alt="image-20231205221920409"></p>
<p>支持多种脚本语言（python3、javaScript、shell、typescript）<br>支持在线管理脚本、环境变量、配置文件<br>支持在线查看任务日志<br>支持秒级任务设置<br>支持系统级通知<br>支持暗黑模式<br>支持手机端操作</p>
<h1 id="二、部署服务"><a href="#二、部署服务" class="headerlink" title="二、部署服务"></a>二、部署服务</h1><p> 创建并切换到文件夹</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mkdir qinglong;cd qinglong </span><br></pre></td></tr></table></figure>

<p>创建 <code>docker-compose.yml</code> 文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi docker-compose.yml</span><br></pre></td></tr></table></figure>

<p>粘贴以下代码</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">&#x27;2&#x27;</span></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line">  <span class="attr">web:</span></span><br><span class="line">    <span class="comment"># alpine 基础镜像版本</span></span><br><span class="line">    <span class="attr">image:</span> <span class="string">whyour/qinglong:latest</span></span><br><span class="line">    <span class="comment"># debian-slim 基础镜像版本</span></span><br><span class="line">    <span class="comment"># image: whyour/qinglong:debian  </span></span><br><span class="line">    <span class="attr">volumes:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="string">./data:/ql/data</span></span><br><span class="line">    <span class="attr">ports:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="string">&quot;0.0.0.0:5700:5700&quot;</span></span><br><span class="line">    <span class="attr">environment:</span></span><br><span class="line">      <span class="comment"># 部署路径非必须，以斜杠开头和结尾，比如 /test/</span></span><br><span class="line">      <span class="attr">QlBaseUrl:</span> <span class="string">&#x27;/&#x27;</span></span><br><span class="line">    <span class="attr">restart:</span> <span class="string">always</span></span><br></pre></td></tr></table></figure>

<p>运行 docker-compose</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose up -d</span><br></pre></td></tr></table></figure>

<p>运行成功后可以执行 <code>docker-compose ps</code> 查看运行状态</p>
<p>输入 ip 加默认端口即可进行访问</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http://ip:5700</span><br></pre></td></tr></table></figure>

<p>四、初始化配置</p>
<p>通过网页访问，进行初始化配置</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205220413863-813001235.png" alt="image-20231205220401595"></p>
<p>设置用户名及密码</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205220526597-2003164793.png" alt="image-20231205220501728"></p>
<p>设置通知方式</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205220541673-1757040949.png" alt="image-20231205220510411"></p>
<p>安装完成</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205220750182-340117331.png" alt="image-20231205220606658"></p>
<p>登录后界面如下所示</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205220833255-908296039.png" alt="image-20231205220811482"></p>
<h1 id="三、更新服务"><a href="#三、更新服务" class="headerlink" title="三、更新服务"></a>三、更新服务</h1><p>停止容器</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose down</span><br></pre></td></tr></table></figure>

<p>拉取最新镜像</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose pull</span><br></pre></td></tr></table></figure>

<p>重新启动容器</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose up -d </span><br></pre></td></tr></table></figure>

<h1 id="四、绑定域名"><a href="#四、绑定域名" class="headerlink" title="四、绑定域名"></a>四、绑定域名</h1><p>以 <code>Nginx Proxy Manager</code> 为例</p>
<p>域名添加一条A记录</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221234746-2116909395.png" alt="image-20231205221155402"></p>
<p>登录 npm，添加一条反向代理</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221348035-1998798022.png" alt="image-20231205221248328"></p>
<p>按照如下配置，添加刚才设置的域名，ip及端口</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221508079-1838260150.png" alt="image-20231205221458581"></p>
<p>添加一个ssl证书</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221626245-1228236582.png" alt="image-20231205221600781"></p>
<p>填写通知邮箱，点击保存即可</p>
<p>点击域名即可自动进行页面跳转</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221820605-1799615561.png" alt="image-20231205221753941"></p>
<p>可直接输入域名进行访问</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231205221844826-1394535746.png" alt="image-20231205221823640"></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9D%A2%E6%9D%BF/" rel="tag">面板</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
    <article
  id="post-宝塔面板申请ssl时域名解析错误或验证URL无法被访问"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/12/09/%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF%E7%94%B3%E8%AF%B7ssl%E6%97%B6%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90%E9%94%99%E8%AF%AF%E6%88%96%E9%AA%8C%E8%AF%81URL%E6%97%A0%E6%B3%95%E8%A2%AB%E8%AE%BF%E9%97%AE/"
    >宝塔面板申请ssl时域名解析错误或验证URL无法被访问!</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/12/09/%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF%E7%94%B3%E8%AF%B7ssl%E6%97%B6%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90%E9%94%99%E8%AF%AF%E6%88%96%E9%AA%8C%E8%AF%81URL%E6%97%A0%E6%B3%95%E8%A2%AB%E8%AE%BF%E9%97%AE/" class="article-date">
  <time datetime="2023-12-09T13:46:51.000Z" itemprop="datePublished">2023-12-09</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E8%B8%A9%E5%9D%91/">踩坑</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一、问题描述"><a href="#一、问题描述" class="headerlink" title="一、问题描述"></a>一、问题描述</h1><p>使用宝塔面板建立站点，申请<code>let‘s Encrypt</code> 免费ssl证书时提示<code>验证失败,域名解析错误或验证URL无法被访!</code></p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231209215008089-1419835390.png" alt="image-20231209214956594"></p>
<p>网上找了各种方案 检查防火墙配置，安全组配置，域名解析，nginx代理等等乱七八糟的配置</p>
<p>检查来检查去发现都没问题，后来我注意到，这个错误提示是去访问本站点内的一个文件返回 404</p>
<p>但是我经过检查发现目录及文件都正常</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231209215515260-1299491478.png" alt="image-20231209215458605"></p>
<p>文件里也有内容</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231209215803513-936652537.png" alt="image-20231209215746687"></p>
<p>后来我发现是nginx代理出了问题，不会自动添加代理配置</p>
<p>另外，还要检查下Nginx运行是否正常，80，443端口是否被占用</p>
<h1 id="二、解决方案"><a href="#二、解决方案" class="headerlink" title="二、解决方案"></a>二、解决方案</h1><p>修改  <code>/www/server/nginx/conf/nginx.conf</code> 文件，</p>
<p>将<code>listen</code> 替换为服务实际端口， 将 <code>server_name</code> 替换为你的域名 ，将 <code>root</code> 替换为你站点的根目录路径即可</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">server &#123;</span><br><span class="line">     listen 80;</span><br><span class="line">     server_name xxxxx;</span><br><span class="line"></span><br><span class="line">     location ^~ /.well-known/acme-challenge/ &#123;</span><br><span class="line">         default_type &quot;text/plain&quot;;</span><br><span class="line">         root /www/wwwroot/xxxx;</span><br><span class="line">     &#125;</span><br><span class="line"></span><br><span class="line">     location / &#123;</span><br><span class="line">         return 301 https://$host$request_uri;</span><br><span class="line">     &#125;</span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure>

<p>如图所示</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231209221125150-1114143846.png" alt="image-20231209221120660"></p>
<p>修改之后重载nginx服务，然后重新用默认80端口访问下资源目录验证下，成功响应</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231209221311537-166066982.png" alt="image-20231209221256719"></p>
<p>重新申请下证书，问题成功解决，完美撒花</p>
<p><img src="https://img2023.cnblogs.com/blog/2233039/202312/2233039-20231209221431089-965642219.png" alt="image-20231209221413428"></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SSL/" rel="tag">SSL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%AE%9D%E5%A1%94%E9%9D%A2%E6%9D%BF/" rel="tag">宝塔面板</a></li></ul>

    </footer>
  </div>

    
 
   
  
</article>

    
  </article>
  

  
  <nav class="page-nav">
    
    <a class="extend prev" rel="prev" href="/">上一页</a><a class="page-number" href="/">1</a><span class="page-number current">2</span><a class="page-number" href="/page/3/">3</a><a class="page-number" href="/page/4/">4</a><span class="space">&hellip;</span><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/3/">下一页</a>
  </nav>
  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2023
        <i class="ri-heart-fill heart_icon"></i> Shiguang
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>    
    </main>
    <div class="float_btns">
      <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

    </div>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="時光"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友链</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-3.6.0.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->

<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->
 <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script> 
<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->
 
<script src="/js/busuanzi-2.3.pure.min.js"></script>
 
<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->
 
<link rel="stylesheet" href="/css/clipboard.css">
 <script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>
 
<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    

  </div>
</body>

</html>